import { fabric } from 'fabric'

//新增图形文字
export const createText = (textName: string, options: Record<string, any> = {}): fabric.IText => {
  // 创建 IText 对象
  const text = new fabric.IText(textName, {
    fontSize: 14,
    fill: '#fff',
    textAlign: 'center',
    type: 'text',
    selectable: false,
    evented: false,
    ...options
  })
  return text
}
